<form action="<?php e_page("comment","index")?> " method="get">
    <fieldset>
        <legend></legend>
        <label for="id">ID</label><br/>
        <input type="text" id="id" name="id" placeholder="请输入评论ID"><br/>
        <label for="name">商品名称</label><br/>
        <input type="text" id="name" name="name" placeholder="请输入商品名称"><br/>
        <label for="real_name">用户名</label><br/>
        <input type="text" id="real_name" name="real_name" placeholder="请输入用户名"><br/>
        <label for="username">联系方式</label><br/>
        <input type="text" id="username" name="username" placeholder="请输入用户联系方式">

        <input type="submit" value="搜索">
    </fieldset>
</form>

<?php if(empty($r['goods_comment'])){ echo "亲，暂时还没有评价信息哦~"?>
<?php }else{?>
    <table id="dataTable">
        <thead>
        <tr>
            <th>ID</th>
            <th>商品名称</th>
            <th>用户名称</th>
            <th>联系方式</th>
            <th>评论</th>
            <th>评论时间</th>
            <th>质量得分</th>
            <th>回复内容</th>
            <th>回复时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($r['goods_comment'] as $v){?>
        <tr>
            <td><?php echo $v['id']?></td>
            <td><?php echo $v['gopen_id'];?></td>
            <td><?php echo $r[$v['user_id']]['real_name'];?></td>
            <td><?php echo $r[$v['user_id']]['username'];?></td>
            <td><?php echo $v['comment'];?></td>
            <td><?php echo $v['create_time'];?></td>
            <td><?php echo $v['score'];?>分</td>
            <td><?php echo $v['reply'];?></td>
            <td><?php echo $v['reply_time'];?></td>
            <td><?php if(empty($v['reply_time'])){?><a href="<?php e_action("reply","id={$v['id']}");?>">回复</a><?php }?></td>
        </tr>
        <?php } ?>
        </tbody>
    </table>
    <?php
    /** @var Page $page */
    $page=$r['pages'];
    ?>
    <?php echo $page->getPageHtml(); ?>
<?php }?>
